﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddSystemNews.aspx.cs"  ValidateRequest="false" Inherits="NJL.WebManage.SystemNews.AddSystemNews" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
    <script type="text/javascript">
        function check() {
            var regInt = /^\d+/; //整数
            var txtSort = document.getElementById("<%=txtSort.ClientID %>").value;
            if (regInt.exec(txtSort) == null) {
                alert("排序只能输入整数");
                return false;
            }
            var txtAttractionsTitle = document.getElementById("<%=txtTitle.ClientID %>").value;
            if (txtAttractionsTitle == "") {
                alert("请输入标题");
                return false;
            }
            var txtSubtitle = document.getElementById("<%=txtSubtitle.ClientID %>").value;
            if (txtSubtitle.length > 500) {
                alert("输入字符数不能超过500个");
                return false;
            }
            var newstype = document.getElementById("<%=dllNewsType.ClientID %>").value;
            if (newstype == "0") {
                alert("请选择类型");
                return false;
            }

            //页面描述
            var txtDescription = document.getElementById("<%=txtSeoDescription.ClientID %>").value;
            if (txtDescription.length > 100) {
                alert("页面描述内容数超过100个字符请重新输入");
                return false;
            }

        }
        function checkHiddenfield1() {
            var checkhid = document.getElementById("Hiddenfield1").value;
            if (checkhid == "0") {
                alert("请先提交后再添加章节");
                return;
            }
          var iTop = (window.screen.availHeight-30-500)/2; //获得窗口的垂直位置;
          var iLeft = (window.screen.availWidth-10-800)/2; //获得窗口的水平位置;
          var url="AddNewsPager.aspx?id="+document.getElementById("Hiddenfield1").value;
          window.open(url, "open1", "height=500, width=800,top="+iTop+",left="+iLeft+",toolbar =no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no") 

        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="gray_bd">
        <div class="table_title">
            新闻管理-添加新闻</div>
        <div class="pad5px">
            <table align="center" cellspacing="0" style="width: 100%">
                   <tr>
                    <td style="width: 120px; text-align: right;">
                        排序：</td>
                    <td>
                        <asp:TextBox ID="txtSort" runat="server" MaxLength="8" Width="50px">0</asp:TextBox>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        标题：
                    </td>
                    <td>
                        <asp:TextBox ID="txtTitle" runat="server" Width="400px" MaxLength="50"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        副标题：
                    </td>
                    <td>
                        <asp:TextBox ID="txtSubtitle" runat="server" Width="400px" TextMode="MultiLine" Height="80"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        类型：
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="dllNewsType" runat="server">
                        </asp:DropDownList>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        标签：
                    </td>
                    <td>
                        <asp:TextBox ID="txtTag" runat="server" Width="400px" MaxLength="100"></asp:TextBox>
                        多个标签请用逗号隔开
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        图片：&nbsp;
                    </td>
                    <td>
                        <asp:FileUpload ID="FileUpload1" runat="server" />
                        上传图片的尺寸要根据前台使用的图片上传
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        是否转向：
                    </td>
                    <td align="left">
                        <asp:RadioButtonList ID="rblIsTurn" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Selected="True" Value="1">是</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        转向地址：
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtTurnUrl" runat="server" Width="400px"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        内容：
                    </td>
                    <td>
                        <asp:TextBox ID="txtContent" runat="server" TextMode="MultiLine" Height="61px" Width="100%"></asp:TextBox>
                        <script type="text/javascript">
                            CKEDITOR.replace('<%=txtContent.ClientID%>',
                            {
                                filebrowserBrowseUrl: '/ckfinder/ckfinder.html', //启用浏览功能
                                filebrowserImageBrowseUrl: '/ckfinder/ckfinder.html?Type=Images',
                                filebrowserFlashBrowseUrl: '/ckfinder/ckfinder.html?Type=Flash',
                                filebrowserUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
                                filebrowserImageUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
                                filebrowserFlashUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
                            }
                            );
                        </script>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        &nbsp;
                    </td>
                    <td align="right">
                        <input id="Button1" type="button" value="添加章节" onclick="checkHiddenfield1()" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        页面标题：
                    </td>
                    <td>
                        <asp:TextBox ID="txtSeoTitle" runat="server" Width="100%" MaxLength="100"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        页面关键字：
                    </td>
                    <td>
                        <asp:TextBox ID="txtSeoKeyworkds" runat="server" Width="100%" MaxLength="100"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 120px; text-align: right;">
                        页面描述：
                    </td>
                    <td>
                        <asp:TextBox ID="txtSeoDescription" runat="server" Height="51px" TextMode="MultiLine"
                            Width="100%"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Style="height: 21px"
                            Text="提交" Width="40px" OnClientClick="return check()" />
                        &nbsp;<input id="Reset1" type="reset" value="重置" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <%--   <script type="text/javascript">
        var control = document.getElementById("txtdefault");
        if (control != null) {
            CKEDITOR.replace('txtdefault',
                            {
                                filebrowserBrowseUrl: '/ckfinder/ckfinder.html', //启用浏览功能
                                filebrowserImageBrowseUrl: '/ckfinder/ckfinder.html?Type=Images',
                                filebrowserFlashBrowseUrl: '/ckfinder/ckfinder.html?Type=Flash',
                                filebrowserUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
                                filebrowserImageUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
                                filebrowserFlashUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
                            }
                            );
        }
       for(var i=0;i<<%=Count %>;i++)
        { 
        if(document.getElementById("txt"+i)!=null)
        {
          CKEDITOR.replace('txt'+i,
                            {
                                filebrowserBrowseUrl: '/ckfinder/ckfinder.html', //启用浏览功能
                                filebrowserImageBrowseUrl: '/ckfinder/ckfinder.html?Type=Images',
                                filebrowserFlashBrowseUrl: '/ckfinder/ckfinder.html?Type=Flash',
                                filebrowserUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
                                filebrowserImageUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
                                filebrowserFlashUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
                            }
                            );
                            }
        }
    </script>--%>
    <asp:HiddenField ID="Hiddenfield1" runat="server" Value="0"></asp:HiddenField>
    </form>
</body>
</html>
